class PlantillasController < ApplicationController
  before_filter :authorized? 

  ## Métodos/acciones typical scaffold ##

  # GET /plantillas
  def index
    @plantillas = Plantilla.find(:all)

    respond_to do |format|
      format.html # index.rhtml
    end
  end

  def show
    @plantilla = Plantilla.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
    end
  end

  def new
    @plantilla = Plantilla.new
  end

  def edit
    @plantilla = Plantilla.find(params[:id])
  end

  def create
    @plantilla = Plantilla.new(params[:plantilla])

    respond_to do |format|
      if @plantilla.save
        flash[:notice] = 'Plantilla was successfully created.'
        format.html { redirect_to plantilla_url(@plantilla) }
      else
        format.html { render :action => "new" }
      end
    end
  end

  def update
    @plantilla = Plantilla.find(params[:id])

    respond_to do |format|
      if @plantilla.update_attributes(params[:plantilla])
        flash[:notice] = 'Plantilla was successfully updated.'
        format.html { redirect_to plantilla_url(@plantilla) }
      else
        format.html { render :action => "edit" }
      end
    end
  end

  def destroy
    @plantilla = Plantilla.find(params[:id])
    @plantilla.destroy

    respond_to do |format|
      format.html { redirect_to plantillas_url }
    end
  end
  
  ## /Métodos/acciones typical scaffold ##
end